#pragma once
#include <iostream>

// TODO: this is abstract Strategy class
struct Strategy {
  virtual ~Strategy() = default;
  virtual void Algo1AsInterface() = 0; // an algorithm method interface
};

// TODO: more clear Strategy, not going to have son class
struct Algo1XMLPrinter final : public Strategy {
  void Algo1AsInterface() override {
    std::cout << "[DEBUG]: algo1 is a xml print method" << std::endl;
  }
};

// TODO: more clear Strategy 2, not going to have son class
struct Algo1JSONPrinter final : public Strategy {
  void Algo1AsInterface() override {
    std::cout << "[DEBUG]: algo1 is a json print method" << std::endl;
  }
};

// TODO:Context
struct Context {
  Context(Strategy *newStrategy) { this->m_strategy = newStrategy; }

  void DoAction() { m_strategy->Algo1AsInterface(); }

private:
  Strategy *m_strategy;
};
